package light.head.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.Formula;
/**
 *	企业招聘信息
 */
@Entity
@Table
public class RecruitInfo implements Serializable{
	private static final long serialVersionUID = -6025662750115292674L;
	private Integer code;				//流水号
	private Integer oc;					//招聘企业
	private String name;				//公司名称
	private String post;				//招聘职位
	private Byte sex;					//性别 (0.不限 1.男 2.女)
	private String age;					//年龄
	private String eb;					//学历 education background 
	private String major;				//专业
	private String num;					//招聘人数
	private String wage;				//薪资
	private String content;				//招聘具体类容
	private Date startTime;				//招聘起始时间
	private Date stopTime;				//招聘截止时间
	private Boolean status;				//状态 (0.招聘中 1.已截止)
	private String phone;				//联系电话
	private String address;				//公司地址
	private	String site;				//公式网址
	private Integer joinNum = 0;		//报名人数
	private Date ct;					//创建时间
	private Integer cu;					//创建人
	private boolean deleted;			//是否删除
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column
	public Integer getCode() {
		return code;
	}
	@Column(updatable = false)
	public Integer getOc() {
		return oc;
	}
	@Formula("(SELECT o.name FROM Organ o WHERE o.code = oc)")
	public String getName() {
		return name;
	}
	@Column(length = 200)
	public String getPost() {
		return post;
	}
	@Column
	public Byte getSex() {
		return sex;
	}
	@Column
	public String getAge() {
		return age;
	}
	@Column
	public String getEb() {
		return eb;
	}
	@Column
	public String getMajor() {
		return major;
	}
	@Column
	public String getWage() {
		return wage;
	}
	@Column
	public String getNum() {
		return num;
	}
	@Column
	public Boolean getStatus() {
		return status;
	}
	@Column(length = 10000)
	public String getContent() {
		return content;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column
	public Date getStartTime() {
		return startTime;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column
	public Date getStopTime() {
		return stopTime;
	}
	@Column(length = 30)
	public String getPhone() {
		return phone;
	}
	@Formula("(SELECT od.address FROM OrganDetails od WHERE od.oc = oc)")
	public String getAddress() {
		return address;
	}
	@Formula("(SELECT od.site FROM OrganDetails od WHERE od.oc = oc)")
	public String getSite() {
		return site;
	}
	@Formula("(SELECT COUNT(*) FROM RecruitJoin rj WHERE rj.rc = code)")
	public Integer getJoinNum() {
		return joinNum;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(updatable = false, nullable = false)
	public Date getCt() {
		return ct;
	}
	@Column(updatable = false, nullable = false)
	public Integer getCu() {
		return cu;
	}
	@Column
	public boolean getDeleted() {
		return deleted;
	}
	
	
	public void setCode(Integer code) {
		this.code = code;
	}
	public void setOc(Integer oc) {
		this.oc = oc;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setPost(String post) {
		this.post = post;
	}
	public void setSex(Byte sex) {
		this.sex = sex;
	}
	public void setAge(String age) {
		this.age = age;
	}
	public void setEb(String eb) {
		this.eb = eb;
	}
	public void setMajor(String major) {
		this.major = major;
	}
	public void setNum(String num) {
		this.num = num;
	}
	public void setStatus(Boolean status) {
		this.status = status;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	public void setStopTime(Date stopTime) {
		this.stopTime = stopTime;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public void setSite(String site) {
		this.site = site;
	}
	public void setWage(String wage) {
		this.wage = wage;
	}
	public void setCt(Date ct) {
		this.ct = ct;
	}
	public void setCu(Integer cu) {
		this.cu = cu;
	}
	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}
	public void setJoinNum(Integer joinNum) {
		this.joinNum = joinNum;
	}
}
